
function login() {
      let uname=document.getElementById("uname").value
    let pwd=document.getElementById("pwd").value

    $.post("http://localhost:8080/projectfirst/UserServlet",{"type":"login","uname":uname,"pwd":pwd},function (data) {
        if(data.code==2){
            location.href="index.html"
        }else{
            alert(data.msg)
        }
    },"json")
}
